package com.zhijian.medical.controller;

import com.zhijian.medical.annotation.Response;
import com.zhijian.medical.entity.vo.response.DeviceDataVo;
import com.zhijian.medical.entity.vo.response.ExperimentProcessSampleDataVo;
import com.zhijian.medical.entity.vo.response.PersonDataVo;
import com.zhijian.medical.service.DataBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author HCG
 * @version 1.0
 * @date 2022/9/20
 */
@Slf4j
@Controller
@Api(tags = "数据看板")
public class DataBoardController {

    @Autowired
    private DataBoardService dataBoardService;

    /**
     * 实验概览
     *
     * @return
     */
    @Response
    @GetMapping("/db/experiment/statistics")
    @ApiOperation("实验概览")
    public ExperimentProcessSampleDataVo createExperimentProcessSampleDataVo() {
        return dataBoardService.createExperimentProcessSampleDataVo();
    }

    /**
     * 设备概览
     *
     * @return
     */
    @Response
    @GetMapping("/db/device/statistics")
    @ApiOperation("设备概览")
    public DeviceDataVo createDeviceDataVo() {
        return dataBoardService.createDeviceDataVo();
    }

    /**
     * 人员概览
     *
     * @return
     */
    @Response
    @GetMapping("/db/person/statistics")
    @ApiOperation("人员概览")
    public PersonDataVo createPersonDataVo() {
        return dataBoardService.createPersonDataVo();
    }
}
